<template>
<div>
    <input v-model="newNumber" type="number">
    <button @click="pushNewNumber(newNumber)">Add new number</button>
</div>
</template>

<script>
import {store} from './store.js'

export default {
    name: "NumberSubmit",
    //这里的数据仅仅用
    data() {
        return {
            newNumber: 0
        }
    },
    methods: {
        //通过store对象处理
        pushNewNumber(newNumber) {
            store.pushNewNumber(newNumber);
        }
    }

}
</script>

